#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int INF=0x3f3f3f3f;
const int N=1e5+10;
int a[N]; 
int b[N];
int idx;
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i+1<n;i++)
	{
		if(a[i]>a[i-1] && a[i]>a[i+1])
		{
			b[idx]=i;
			idx++;
		}
	}
	if(idx%2==0 && idx>=1)
	{
		cout<<b[idx/2-1]+1;
	}
	else if(idx%2 && idx>=1) 
	{
		cout<<b[idx/2]+1;
	}
	else if(idx==0)
	{
		cout<<-1;
	}

	return 0;
}

